import request from '@/utils/request'
// ========================= 管理 ======================================
// Get Accompany
export const QueryAccompany = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/accompany/manage/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}
// Dispatch Accompany
export const DispatchAccompany = (data) => {
  return request({
    url: '/v1/prse/accompany/manage/',
    method: 'post',
    data,
  })
}

// Active Record To Special Work
export const ActiveAddSpecialRecord = (rid) => {
  return request({
    url: '/v1/prse/accompany/manage/addSpecialWork/',
    method: 'post',
    params: { rid },
  })
}

// ------------------------- 用户 --------------------------------------

// Create My Accompany
export const CreateAccompany = (data) => {
  return request({
    url: '/v1/prse/accompany/my/',
    method: 'post',
    data,
  })
}

// Query My Accompany
export const QueryMyAccompany = (page, pageSize) => {
  return request({
    url: '/v1/prse/accompany/my/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
    },
  })
}

// Evaluate My Accompany
export const EvaluateMyAccompany = (data) => {
  return request({
    url: '/v1/prse/accompany/myEvaluate/',
    method: 'post',
    data,
  })
}

// Preview My Lecture File
export const GetAccompanyPreviewImages = (rid) => {
  return request({
    url: '/v1/prse/accompany/my/dataPreView/',
    method: 'get',
    params: { rid },
  })
}

// ============================== 工作者 =========================
// Get Accompany
export const QueryAccompanyToMe = (page, pageSize, state) => {
  return request({
    url: '/v1/prse/accompany/worker/',
    method: 'get',
    params: {
      page: page,
      page_size: pageSize,
      state,
    },
  })
}

// Post Annex File (Finished)
export const FinishAccompanyToMe = (data) => {
  return request({
    url: '/v1/prse/accompany/worker/',
    method: 'post',
    data,
  })
}
